<!-- MSBR02（团体淘汰赛对阵表） -->
<template>
  <div>
    <div class="item-info">
      <div
        :class="['single-item', item.flag ? 'active-item' : '']"
        v-for="(item, index) in singleItemList"
        :key="index"
      >
        <div>{{ item.name }}</div>
        <div class="item-logo">
          <img :src="item.logo" alt="" />
        </div>
      </div>
      <div class="single-item-info">
        <div class="info-line1">
          <div>{{ gameTitle }}</div>
          <div class="venue">{{ venueName }}</div>
        </div>
        <div class="info-line2">
          <div class="report-name">对阵表</div>
          <div>{{ gameTime }}</div>
        </div>
      </div>
    </div>
    <div class="game-table-data">
      <el-table :data="reportData" style="width: 100%">
        <el-table-column
          prop="Table"
          label="桌号"
          header-align="center"
          align="center"
        ></el-table-column>
        <el-table-column label="主队" prop="Team1"> </el-table-column>
        <el-table-column label="客队" prop="Team2" min-width="130%"> </el-table-column>
        <el-table-column label="轮次" prop="Round" min-width="130%"> </el-table-column>
        <el-table-column label="轮内序号" prop="MatchOrder"></el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
export default {
  created() {
    this.venueName = this.$route.query.venueName
    this.gameTime = this.$route.query.gameTime
    this.gameTitle = this.$route.query.gameTitle
    this.filePath = this.$route.query.filePath
    this.getReportData()
  },
  props: {},
  data() {
    return {
      filePath: '',
      venueName: '',
      gameTime: '',
      gameTitle: '',
      startList: [
        {
          Table: '1',
          Team1: '1',
          Round: '1',
          MatchOrder: '1',
          Team2: '1'
        }
      ],
      singleItemList: [
        {
          name: '桥牌',
          logo: require('@/assets/img/daily/BR.png'),
          flag: true
        }
      ]
    }
  },
  watch: {},
  computed: {
    ...mapState({
      reportData: state => state.schedule.reportData
    })
  },
  filters: {},
  components: {},
  methods: {
    getReportData() {
      this.$store
        .dispatch('getReportData', this.filePath + '.txt')
        .then(_ => {})
        .catch(error => {
          console.log(error)
        })
    }
  }
}
</script>
<style scoped lang="scss">
@import '@/assets/scss/item.scss';
</style>
